#include <iostream>
#include <ctime>

#include "2geom/svg-path-parser.h"
#include "2geom/pathvector.h"
#include "2geom/path.h"
#include "2geom/d2.h"
#include "2geom/piecewise.h"
#include "2geom/sbasis.h"
using namespace Geom;

static char const *many_subpaths =
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 "
    "M 240,495.21933 648.57143,400.93361 C 190.6809,177.20365 122.07669,234.71591 104.6,312.5 ";




int main()
{
    for (int rep = 0; rep < 3; rep++) {
        const int num_repeats = 100;
        PathVector path = parse_svg_path(many_subpaths);
        std::clock_t start = std::clock();
        for (int i = 0; i < num_repeats; i++) {
            PathVector path2 = path.reversed();
            PathVector path3 = path2.reversed().reversed();
        }
        std::clock_t stop = std::clock();
        std::cout << "Reverse paths (" << num_repeats << "x): " << (stop - start) * (1000. / CLOCKS_PER_SEC) << " ms " << std::endl;
    }
}



//
